package edu.hda.pt.utils;

import java.io.Serializable;
import java.util.HashMap;

/**
 * The class TestObject provides an object which can be sent between the client
 * and the server. As instance variables it has two HashMaps with dummy values.
 * 
 * @author Marc Hammerton
 * 
 */
public class TestObject implements Serializable {

	private static final long serialVersionUID = 8767612047032222020L;

	private HashMap<String, String> mapStringString;
	private HashMap<String, Object> mapStringObject;

	/**
	 * Constructor setting up the two HashMaps.
	 */
	public TestObject() {
		mapStringString = new HashMap<String, String>();
		initMapStringString();

		mapStringObject = new HashMap<String, Object>();
		initMapStringObject();
	}

	/**
	 * @return the mapStringString
	 */
	public HashMap<String, String> getMapStringString() {
		return mapStringString;
	}

	/**
	 * @return the mapStringObject
	 */
	public HashMap<String, Object> getMapStringObject() {
		return mapStringObject;
	}

	/**
	 * Initializes the HashMap with String values
	 */
	private void initMapStringString() {
		for (int i = 0; i < 5; i++) {
			mapStringString.put("key" + i, "value" + i);
		}
	}

	/**
	 * Initializes the HashMap with String objects
	 */
	private void initMapStringObject() {
		for (int i = 0; i < 5; i++) {
			mapStringObject.put("key" + i, new String());
		}
	}
}
